<?php

namespace Framework\auth\bean;
/**
 * Jwt授权认证配置
 * Class JwtTokenConfigBean
 * @package Framework\auth\bean
 * @author 飞鸟和鱼
 */
class JwtTokenConfigBean
{
    /**
     * @var float|int token授权过期时间
     */
    private $expire = 60 * 60 * 24 * 3;

    /**
     * @var string 存储token信息Key
     */
    private $token_prefix_key = "login:user:token:";

    /**
     * @var string 存储用户信息Key
     */
    private $info_prefix_key = "login:user:info:";

    /**
     * @var string 单点登录过期凭证Key
     */
    private $token_sso_key = "login:user:sso:";

    /**
     * @var bool 是否开启单点登录
     */
    private $sso = true;

    /**
     * @var bool 是否开启游客访问
     */
    private $vistor = true;

    /**
     * @var string 游客身份凭证Key
     */
    private $vistor_key = "login:user:visitor";

    /**
     * @var array 使用游客访问时返回的默认数据
     */
    private $vistor_data = [];

    /**
     * @var string 表主键
     */
    private $pk = "id";

    /**
     * @return float|int
     */
    public function getExpire()
    {
        return $this->expire;
    }

    /**
     * @param float|int $expire
     */
    public function setExpire($expire): void
    {
        $this->expire = $expire;
    }

    /**
     * @return string
     */
    public function getTokenPrefixKey(): string
    {
        return $this->token_prefix_key;
    }

    /**
     * @param string $token_prefix_key
     */
    public function setTokenPrefixKey(string $token_prefix_key): void
    {
        $this->token_prefix_key = $token_prefix_key;
    }

    /**
     * @return string
     */
    public function getInfoPrefixKey(): string
    {
        return $this->info_prefix_key;
    }

    /**
     * @param string $info_prefix_key
     */
    public function setInfoPrefixKey(string $info_prefix_key): void
    {
        $this->info_prefix_key = $info_prefix_key;
    }

    /**
     * @return string
     */
    public function getTokenSsoKey(): string
    {
        return $this->token_sso_key;
    }

    /**
     * @param string $token_sso_key
     */
    public function setTokenSsoKey(string $token_sso_key): void
    {
        $this->token_sso_key = $token_sso_key;
    }


    /**
     * @return bool
     */
    public function isSso(): bool
    {
        return $this->sso;
    }

    /**
     * @param bool $sso
     */
    public function setSso(bool $sso): void
    {
        $this->sso = $sso;
    }

    /**
     * @return bool
     */
    public function isVistor(): bool
    {
        return $this->vistor;
    }

    /**
     * @param bool $vistor
     */
    public function setVistor(bool $vistor): void
    {
        $this->vistor = $vistor;
    }

    /**
     * @return string
     */
    public function getVistorKey(): string
    {
        return $this->vistor_key;
    }

    /**
     * @param string $vistor_key
     */
    public function setVistorKey(string $vistor_key): void
    {
        $this->vistor_key = $vistor_key;
    }

    /**
     * @return array
     */
    public function getVistorData(): array
    {
        return $this->vistor_data;
    }

    /**
     * @param array $vistor_data
     */
    public function setVistorData(array $vistor_data): void
    {
        $this->vistor_data = $vistor_data;
    }



    /**
     * @return string
     */
    public function getPk(): string
    {
        return $this->pk;
    }

    /**
     * @param string $pk
     */
    public function setPk(string $pk): void
    {
        $this->pk = $pk;
    }


}